-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
CLN: Expose arguments in DataFrame.query #61413
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR!
@@ -4624,8 +4694,15 @@ def query(self, expr: str, *, inplace: bool = False, **kwargs) -> DataFrame | No | |||
if not isinstance(expr, str): | |||
msg = f"expr must be a string to be evaluated, {type(expr)} given" | |||
raise ValueError(msg) | |||
kwargs["level"] = kwargs.pop("level", 0) + 1 | |||
kwargs["target"] = None | |||
kwargs: Any = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It appears to me there is no reason to construct a dict here anymore. Assuming that's correct, can you instead pass these as normal function arugments.
@@ -401,6 +401,7 @@ Other API changes | |||
- Index set operations (like union or intersection) will now ignore the dtype of | |||
an empty ``RangeIndex`` or empty ``Index`` with object dtype when determining | |||
the dtype of the resulting Index (:issue:`60797`) | |||
- :meth:`DataFrame.query` does not accept ``**kwargs`` anymore and requires passing keywords for desired arguments (:issue:`61405`) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since this is fully backwards compatible, I think we do not need to mention this in the whatsnew.
doc/source/whatsnew/vX.X.X.rst
file if fixing a bug or adding a new feature.